import pandas as pd

df = pd.read_csv('../static/data/farm_produce.csv')
df['价格'] = df[['单位', '价格']].apply(lambda x: round(x['价格'] / 1000, 5) if '吨' in x['单位'] else x['价格'], axis=1)
df['单位'] = df['单位'].apply(lambda x: '元/千克')
df['日期'] = df.apply(lambda x: f"{x['年份']}-{x['月份']}-{x['日期']}", axis=1)
df.to_csv('../static/data/farm_produce_pre.csv', index=False)
